#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
cx_Freeze 打包配置
适用于Python 3.13
"""

import sys
from cx_Freeze import setup, Executable

# 包含的模块
includes = [
    "PyQt5.QtCore", "PyQt5.QtGui", "PyQt5.QtWidgets",
    "numpy", "pandas", "matplotlib", "openpyxl", "psutil",
    "xml.etree.ElementTree", "logging"
]

# 排除的模块
excludes = [
    "tkinter", "unittest", "test", "distutils",
    "email", "http", "urllib", "xml.dom", "xml.sax"
]

# 包含的文件
include_files = [
    "frame_schema.xml",
    "logger.py",
    "frame_processor.py", 
    "visualization.py",
    "progress_dialog.py",
    "frame_schema_parser.py",
    "log_analyzer.py"
]

# 可执行文件配置
executables = [
    Executable(
        "main.py",
        base="Win32GUI" if sys.platform == "win32" else None,
        target_name="成帧数据应用软件.exe" if sys.platform == "win32" else "成帧数据应用软件",
        icon=None  # 如果有图标文件，可以指定路径
    )
]

setup(
    name="成帧数据应用软件",
    version="1.0.0",
    description="成帧数据分析和处理软件",
    author="Your Name",
    options={
        "build_exe": {
            "includes": includes,
            "excludes": excludes,
            "include_files": include_files,
            "optimize": 2,
            "include_msvcrt": True,
        }
    },
    executables=executables
)
